$(function() {
	$(".code-icon").hide();
	$("#suspend_weixin_close").click(function(){
		$(this).parent().hide(1000);
		$(".code-icon").show(1000);
	});
	$(".code-icon").click(function(){
		$(this).hide(1000);
		$(".suspend-weixin").show(1000);
	});
	$(".user-reply").click(function(){
		var liBox = $(this).parent().parent().parent();
		var input = liBox.find(".replyInput");
		if(input.hasClass("cif")){
			input.remove();
		}else{
			liBox.append(replyInput());
		}
	});
	$(".published").live("click",function(){
		var MliBox = $(this).parent().parent();
		var txt = $(this).parent().find("textarea").val();
		if(txt == ""){
			alert("内容不能为空！");
		}else{
			MliBox.find(".comment-list-reply").append(replyContent(txt));
			$(this).parent().remove();
		}
	});
});
function replyInput(){
	var html = "";
	html = html + "<p class=\"replyInput cif\">";
	html = html + "<textarea name=\"text\" maxlength=\"100\" placeholder=\"请回复内容在100字以内\"></textarea>";
	html = html + "<input type=\"submit\" name=\"Submit\" value=\"提交\" class=\"published\" />"
	html = html + "</p>";
	return html;
}
function replyContent(replycontent){
	var date = new Date();
	var time = date.getHours() + ":" + date.getMinutes();
	var html = "";
	html = html + "<p>";
	html = html + "<a class=\"user-name\">牛吃草草吃牛</a>:";
	html = html + "<span>"+replycontent+"</span>"
	html = html + "<span class=\"reply-time\">今天 "+time+"</span>"
	html = html + "</p>";
	return html;
}